#include "coada.h"
#include <iostream>
template<class T>Coada<T>::Coada(){
  this->fata=NULL;
	this->spate=NULL;
  this->nr=0;
}
template<class T>bool Coada<T>::isEmpty()const{
  return this->fata==NULL;
}
template<typename T>int Coada<T>::size()const{
  return this->nr;
}
template<typename T>void Coada<T>::add(T ob){
  if(isEmpty())
  {
      this->fata=new Nod;
      this->fata->info=ob;
      this->fata->next=NULL;
      this->spate=this->fata;
      nr=1;
  }
  else
  {
      Nod *p=new Nod;
      p->info=ob;
      p->next=NULL;
      this->spate->next=p;
      this->spate=p;
      ++nr;
  }
}
template<typename T>void Coada<T>::pop_back(){
  if(isEmpty()) std::cout<<"Coada Vida!";
  Nod *q=this->fata;
  this->fata=this->fata->next;
  delete q;
  --nr;
}

template<typename T>Coada<T>::~Coada(){
	delete this->fata;
}
template<typename T>T Coada<T>::pop_front()const{
    if(isEmpty()) std::cout<<"Coada Vida!";
    return this->fata->info;
}
